<template>
    <dl>
        <dt>
            <img :src="item.img" alt="">
        </dt>
        <dd>
            <h3>标题:{{item.title}}</h3>
            <p>内容:{{item.content}}</p>
            <p>价格:{{item.price}}</p>
            <p @click="add">购物</p>
        </dd>
    </dl>
</template>
<script>
import {mapMutations} from 'vuex'
export default {
    props:['item'],
    methods:{
        ...mapMutations(['addProduct']),
        add(){
            this.addProduct(this.item);
        }
    }
}
</script>
